<extend name="Public:base" />

<block name="content">	
	
<table class="table table-striped table-bordered table-hover search-form">
	<thead>
		<th><input name="order_num" type="text" placeholder="输入订单号" value="{:I('order_num')}" /></th>
		<th><input name="user_name" type="text" placeholder="输入会员名" value="{:I('user_name')}" /></th>		
		<th>    				
			<select name="status">
				<option value="">-选择状态-</option>
				<volist name="status" id="v" >
					<option <?php if(isset($get_status)&&($get_status==$v['order_status_id'])){echo ' selected="selected"';} ?> value="{$v.order_status_id}">{$v.name}</option>
				</volist>	
			</select>
		</th>
		<th>
			<a class="btn btn-primary" href="javascript:;" id="search" url="{:U('Order/index')}">查询</a>
		</th>
	</thead>
</table>	
	
	
<div class="row">
	<div class="col-xs-12">	
		<div class="table-responsive">
			<table class="table table-striped table-bordered table-hover">
				<thead>
					<tr>											
						<th>ID</th>
						<th>订单号</th> 
						<th>总计</th> 						
						<th>会员名</th>					
						<th>状态</th>	
						<th>下单时间</th>					
						<th>操作</th>				
					</tr>
				</thead>
				<tbody>
						<volist name="list" id="v" empty="$empty">
						<tr>						
							<td>{$v.order_id}</td>
							<td>{$v.order_num_alias}</td>
							<td>{$v.total}</td>
							
							<td>{$v.uname}</td>
							<td>{$v.name}</td>
							<td>
								<?php echo date('Y-m-d H:i:s',$v['date_added']); ?>
							</td>
							<td>
								<a  class="btn btn-xs btn-info" href='{:U("Order/show_order",array("id"=>$v["order_id"]))}'>
									<i class="icon-eye-open bigger-120"></i>
								</a> 
								
								<a  class="btn btn-xs btn-info" href='{:U("Order/print_order",array("id"=>$v["order_id"]))}'>
									<i class="icon-print bigger-120"></i>
								</a> 
								
								<a class="delete btn btn-xs btn-danger" href='{:U("Order/del",array("id"=>$v["order_id"]))}' >
									<i class="icon-trash bigger-120"></i>
								</a>
							</td>
						</tr>
						</volist>	
						
						<tr>
							<td colspan="20" class="page">{$page}</td>
						</tr>
				</tbody>
				
			</table>
		</div>
	</div>
</div>
</block>
<block name="javascript">
<script>	
$(function(){
   $("#search").click(function () {
        var url = $(this).attr('url');
        var query = $('.search-form').find('input,select').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
        query = query.replace(/^&/g, '');
        if (url.indexOf('?') > 0) {
            url += '&' + query;
        } else {
            url += '?' + query;
        }
        window.location.href = url;
    });	
});
</script>
</block>